export const formatCurrentTime = (): string => {
  const now = new Date()
  return now.toLocaleString('zh-CN')
}

export const startTimer = (callback: () => void): number => {
  return window.setInterval(callback, 1000)
}

export const stopTimer = (timer: number): void => {
  if (timer) {
    clearInterval(timer)
  }
}